//
//  MYY_walletViewCell.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/1.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYY_walletViewCell.h"


@interface MYY_walletViewCell()

@property(nonatomic, strong) UIImageView *indicatorView;

@end
@implementation MYY_walletViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"MYY_walletViewCell";
    MYY_walletViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[MYY_walletViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
        cell.selectionStyle          = UITableViewCellSelectionStyleNone;
        cell.backgroundColor         = [UIColor whiteColor];
    }
    
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initCreatUI];
        
    }
    return self;
}

-(void)initCreatUI
{
    [self addSubview:self.nameView];
    [self addSubview:self.indicatorView];
    [self addSubview:self.contentLable];
    [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).with.offset(15);
        make.top.equalTo(self.mas_top).mas_offset(13);
    }];
    [self.indicatorView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).with.offset(-20);
        make.centerY.equalTo(self);
    }];
    [self.contentLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameView);
        // make.right.equalTo(self.indicatorView.mas_left).with.offset(-12);
        make.top.equalTo(self.nameView.mas_bottom).mas_offset(5);
    }];
   
}


#pragma mark - property
- (UILabel *)nameView
{
    if (_nameView == nil) {
        _nameView = [UILabel new];
        _nameView.backgroundColor = [UIColor clearColor];
        _nameView.numberOfLines = 1;
        _nameView.textColor = MYYtitleColor;
        _nameView.font = [UIFont systemFontOfSize:15.0];
        _nameView.text = @"收藏";
    }
    return _nameView;
}
- (UILabel *)contentLable
{
    if (_contentLable == nil) {
        _contentLable = [UILabel new];
        _contentLable.backgroundColor = [UIColor clearColor];
        _contentLable.numberOfLines = 1;
        _contentLable.textColor = MYY_cell_SubtitleColor;
        _contentLable.font = MYYFont(15.0);
        _contentLable.text = @"的卡夫卡";
    }
    return _contentLable;
}
- (UIImageView *)indicatorView
{
    if (_indicatorView == nil) {
        _indicatorView = [[UIImageView alloc] init];
        _indicatorView.backgroundColor = [UIColor clearColor];
        _indicatorView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"youxiangjian"]];
    }
    return _indicatorView;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
